package test230325one;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/3/25 22:38
 * 用户
 */
public class User {

    private String name; // 姓名

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private WashingMachine washingMachine; // 洗衣机

    // 买洗衣机
    public void buyWashingMachine(WashingMachine washingMachine) {
        this.washingMachine = washingMachine;
    }


    // 用洗衣机
    public void use(){
        System.out.println("我的洗衣机信息: ");
        System.out.println(washingMachine.getBrand());
        System.out.println(washingMachine.getPrice());
        System.out.println(washingMachine.getName());
        washingMachine.doTheLaundry(); // 洗衣服
    }
}